package webwinkelapp;

import java.util.ArrayList;
import java.util.List;

/**
 * This class represents a Winkelmand
 * @author Rutger Broerze and Stefan Blok
 */
public class Winkelmand {
    private List<Product> winkelmand;
    
    public Winkelmand()
    {
        winkelmand = new ArrayList<Product>();
    }
    
    /**
     * This method adds a {@link Product}, specified by the product parameter, to the Winkelmand
     * @param product A {@link Product} to add in the Winkelmand
     */
    public void addProduct(Product product)
    {
        winkelmand.add(product);
    }
    
    /**
     * This method writes down the amount of products in the Winkelmand and the specific products that are in it.
     */
    @Override
    public String toString()
    {
        System.out.println("U heeft het volgende in uw winkelmand:");
        System.out.println("Er zitten " + winkelmand.size() + " producten in uw winkelmand\n");
        
        for(Product product: winkelmand)
        {
            System.out.println(product.toString());
        }
        
        return "";
    }
}
